#ifndef __ZAPI_ASYNC_TYPES_H__
#define __ZAPI_ASYNC_TYPES_H__

enum {
    // System

    // Human-Machine Interface
    ZENR_FS_SystemShutDown,
    // File system
    ZENR_FS_FlashFXDeviceIoctl,
    ZENR_FS_FlashFXDeviceIO,
    // TF card
    ZENR_FS_TFCardOpen,
    ZENR_FS_TFCardClose,
    ZENR_FS_TFCardIO,
    ZENR_FS_TFCardCapacity,

    // MDT
    ZENR_MDT_AudioLoopbackTest,
    ZENR_MDT_SDTest,
    ZENR_MDT_Engr_GSMMaxPower,
    ZENR_MDT_Usb_Mass,
    ZENR_MDT_FIH_modem_em_mode,

    // Touch
    ZENR_Touch_SetMode,
    ZENR_Touch_SetWriteArea,
    ZENR_Touch_SetRecType,
    ZENR_Touch_SleepEnable,
    ZENR_Touch_Calibration_Start,
    ZENR_Touch_Calibration_End,
    ZENR_Touch_SetRecTime,
    ZENR_Touch_Start_Rec,
    ZENR_Touch_Abort_Rec,
    ZENR_Touch_Vibration,

    //Camera
    ZENR_Camera_Deinit,
    ZENR_Camera_Start,
    ZENR_Camera_Stop,
    ZENR_Camera_SetFlashLED,
    ZENR_Camera_SetBrightness,
    ZENR_Camera_SetWhiteBalance,
    ZENR_Camera_SetColoreffects,
    ZENR_Camera_SetContrast,
    ZENR_Camera_SetScenemode,

    ZENR_RTC_GetRtcTime,

    ZENR_FM_On,
    ZENR_FM_Off,
    ZENR_FM_SetBand,
    ZENR_FM_SetMoStMode,
    ZENR_FM_SetRssiSeachLevel,

    ZENR_ASYNC_API_MAX_INDEX  // Must be last
};

typedef struct T_ZENR_DEVICE_PAYLOAD {
    /* [in] */  Uint32  completionEvent; // Must be first
    /* [in] */  Uint32  controlCode1;
    /* [in] */  Uint32  controlCode2;
    /* [in] */  Uint8   *inbuf;
    /* [in] */  Uint8   *outbuf;
    /* [in] */  Uint32  inbufsize;
    /* [in] */  Uint32  outbufsize;
    /* [out] */ Uint32  *pOutbufused;
    /* [out] */ Uint32  retvalue;
} T_ZENR_DEVICE_PAYLOAD;


//===========================================================================
// System
//


//===========================================================================
// File system
//
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_FS_SystemShutDown;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_FS_FlashFXDeviceOpen;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_FS_FlashFXDeviceClose;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_FS_FlashFXDeviceIoctl;

typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_FS_TFCardOpen;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_FS_TFCardClose;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_FS_TFCardCapacity;

typedef struct T_ZENR_FS_FlashFXDeviceIO {
    /* [in] */  Uint32  completionEvent; // Must be first
    /* [in] */  Uint16  uDriveNum;
    /* [in] */  Uint32  ulSectorNum;
    /* [in] */  void    *pClientBuffer;
    /* [in] */  Uint16  uSectorCount;
    /* [in] */  Uint16  fReading;
    /* [out] */ Uint32  retvalue;
} T_ZENR_FS_FlashFXDeviceIO;

typedef T_ZENR_FS_FlashFXDeviceIO T_ZENR_FS_TFCardIO;


//===========================================================================
// MDT
//
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_MDT_AudioLoopbackTest;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_MDT_SDTest;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_MDT_Engr_GSMMaxPower;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_MDT_Usb_Mass;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_MDT_FIH_modem_em_mode;


//===========================================================================
// Touch
//
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_Touch_SetMode;

typedef struct {
    unsigned char topLeftX;
    unsigned char topLeftY;
    unsigned char bottomRightX;
    unsigned char bottomRightY;
} T_ZENR_Touch_SetWriteArea;

typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_Touch_SetRecType;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_Touch_SleepEnable;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_Touch_Calibration_Start;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_Touch_Calibration_End;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_Touch_SetRecTime;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_Touch_Start_Rec;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_Touch_Abort_Rec;
typedef T_ZENR_DEVICE_PAYLOAD T_ZENR_Touch_Vibration;

typedef struct T_ZENR_Camera_DeviceIO {
    /* [in] */  Uint32  completionEvent; // Must be first
    /* [in] */  Uint32  controlCode1;
    /* [in] */  Uint32  controlCode2;
    /* [out] */ Uint32  retvalue;
} T_ZENR_Camera_DeviceIO;

typedef struct T_ZENR_Camera_StartIO {
    /* [in] */  Uint32  completionEvent; // Must be first
    /* [in} */  Uint32  mode;
    /* [in} */  Uint32  ptrAppBuff;
    /* [in} */  Uint32  numAppBuffs;
    /* [in} */  Uint32  iWidth;
    /* [in} */  Uint32  iHeight;
    /* [in} */  Uint32  pCallBackFunc;
    /* [out] */ Uint32  retvalue;
} T_ZENR_Camera_StartIO;

typedef T_ZENR_Camera_DeviceIO T_ZENR_Camera_Deinit;
typedef T_ZENR_Camera_StartIO  T_ZENR_Camera_Start;
typedef T_ZENR_Camera_DeviceIO T_ZENR_Camera_Stop;
typedef T_ZENR_Camera_DeviceIO T_ZENR_Camera_SetFlashLED;
typedef T_ZENR_Camera_DeviceIO T_ZENR_Camera_SetBrightness;
typedef T_ZENR_Camera_DeviceIO T_ZENR_Camera_SetWhiteBalance;
typedef T_ZENR_Camera_DeviceIO T_ZENR_Camera_SetColoreffects;
typedef T_ZENR_Camera_DeviceIO T_ZENR_Camera_SetContrast;
typedef T_ZENR_Camera_DeviceIO T_ZENR_Camera_SetScenemode;

//===========================================================================
// RTC
//
typedef struct T_ZENR_Rtc_DeviceIO {
    /* [in] */  Uint32  completionEvent; // Must be first
    /* [out] */	void *  rtcTimeBuf;
    /* [out] */ Uint32  retvalue;
}T_ZENR_Rtc_DeviceIO;

typedef T_ZENR_Rtc_DeviceIO T_ZENR_RTC_GetRtcTime;


typedef struct T_ZENR_FM_DeviceIO {
    /* [in] */  Uint32  completionEvent; // Must be first
    /* [in] */  Uint32  controlCode;
    /* [out] */ Uint32  retvalue;
} T_ZENR_FM_DeviceIO;

typedef T_ZENR_FM_DeviceIO T_ZENR_FM_On;
typedef T_ZENR_FM_DeviceIO T_ZENR_FM_Off;
typedef T_ZENR_FM_DeviceIO T_ZENR_FM_SetBand;
typedef T_ZENR_FM_DeviceIO T_ZENR_FM_SetMoStMode;
typedef T_ZENR_FM_DeviceIO T_ZENR_FM_SetRssiSeachLevel;

#endif // __ZAPI_ASYNC_TYPES_H__
